<template name="videoitems">
	<view class="videoitem" :class="lang+'layout'" @click="clickplay(ids,itemlist)">
		<view class="videoimg">
			<image lazy-load="true" :src="pic"></image>
			<view class="videocount" style="direction: ltr;">
				<u-icon name="play-right" color="#FFFFFF"></u-icon>
				{{count}}
			</view>
			<view class="tj">
				{{$t('indexs.会员专享')}}
			</view>
		</view>
		<view class="videotitle font-25">
			<view class="videotiltetext">{{title}}</view>
			<!-- <view class="pass">
				{{$t('indexs.通过率')}}99%
			</view> -->
		</view>

		<!-- <paybox :show="show"></paybox> -->
	</view>
</template>

<script>
	export default {
		name: "videoitems",
		props: ["lang", "ids", "title", "pic", "count", "itemlist"],
		data() {
			return {
				// show: false
			}
		},
		methods: {
			clickplay(e) {
				
				var that = this;
				var idsd = that.ids;
				// console.log("list",that.itemlist)
				// console.log(idsd);
				
			let userinfo = uni.getStorageSync('user_infos')
			let tiyan = uni.getStorageSync('tiyan_times')
			console.log("999999999999///////////",userinfo.userstatus,tiyan);
			// return
			if ((parseInt(userinfo.userstatus) < 1 && tiyan === 0)  || (parseInt(userinfo.userstatus) < 1 && tiyan == "")) {
				 this.sendData()
			}else{
				var itemjson = that.itemlist;
				uni.navigateTo({
					url:'../media/play?vid='+itemjson.vid+'&type='+itemjson.type+'&kemu='+itemjson.kemu
				})
			}
				
			},
			
			sendData() {
				this.$emit('custom-event', true);
			}
		}
	}
</script>

<style scoped lang="scss">
	.videoitem {
		width: 315rpx;
		height: 244rpx;
		display: inline-block;
		margin-bottom: 20rpx;
	}

	.videoimg {
		width: 315rpx;
		height: 194rpx;
		position: relative;

		.videocount {
			height: 50rpx;
			display: inline-block;
			color: #ffffff;
			position: absolute;
			bottom: -10rpx;
			right: 5rpx;
		}

		.tj {
			// width: 61rpx;
			// height: 27rpx;
			background: black;
			border-radius: 0rpx 16rpx 16rpx 0rpx;
			opacity: 1;
			font-size: 20rpx;
			// font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #ffffff;
			line-height: 27rpx;
			text-align: center;
			position: absolute;
			top: 17rpx;
			left: 0rpx;
			padding:4rpx 7rpx;
		}

	}

	.videoimg image {
		width: 315rpx;
		height: 194rpx;
		border-radius: 20rpx;
		border: solid 1rpx #20231D;
		position: absolute;
	}

	.videotitle {
		width: 315rpx;
		height: 50rpx;
		display: flex;
		justify-content: space-between;
		flex-flow: row wrap;
		line-height: 50rpx;
	}

	.kzlayout .videotitle {
		line-height: 70rpx !important;
	}

	.uylayout .videotitle {
		line-height: 70rpx !important;
	}

	.videotiltetext {
		height: 50rpx;
		display: inline-block;
		max-width: 300rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.pass {
		width: 131rpx;
		// height: 30rpx;
		background-color: #F0FFF9;
		border-radius: 4rpx;
		font-size: 22rpx;
		font-family: PingFang SC-Regular, PingFang SC;
		font-weight: 400;
		color: #55C79F;
		line-height: 30rpx;
		margin-top: 8rpx
	}
</style>
